﻿using Vision001.Helper;
using Vision001.ViewModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Vision001.Views
{
    /// <summary>
    /// IODebugView.xaml 的交互逻辑
    /// </summary>
    public partial class IODebugView : UserControl
    {
        public IODebugView()
        {
            InitializeComponent();
            this.DataContext = new IODebugViewModel(this);
        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
        }

        private void CloseAllIO(object sender, RoutedEventArgs e)
        {
            Global._PqwIoCommon.OffAll();
        }

        /// <summary>
        /// 设置当前相机曝光
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void setexpours(object sender, RoutedEventArgs e)
        {
            if (float.TryParse(CameraEx.Text, out float value))
            {
                Global._HKcamera.SetExposure(value);
            }
        }
    }
}